/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * @Date: 2022-04-23 12:22:19
 * @LastEditors: Sam
 * @LastEditTime: 2022-07-13 04:01:11
 */
import request from '@/utils/request'

/**
 * 列表
 * @param params
 * @returns {AxiosPromise}
 */
export function list(params) {
  return request({
    url: '/admin/group',
    method: 'get',
    params
  })
}

/**
 * 创建
 * @param data
 * @returns {AxiosPromise}
 */
export function create(data) {
  return request({
    url: '/admin/group_create',
    method: 'post',
    data
  })
}

/**
 * 修改
 * @param id
 * @param data
 * @returns {AxiosPromise}
 */
export function update(id, data) {
  return request({
    url: `/admin/group_update/${id}`,
    method: 'post',
    data
  })
}

/**
 * 详情
 * @param id
 * @returns {AxiosPromise}
 */
export function detail(id) {
  return request({
    url: `/admin/group_detail/${id}`,
    method: 'get'
  })
}

/**
 * 删除
 * @param id
 * @returns {AxiosPromise}
 */
export function del(id) {
  return request({
    url: `/admin/group_delete/${id}`,
    method: 'post'
  })
}

/**
 * 权限列表
 * @returns {AxiosPromise}
 */
export function rule(params) {
  return request({
    url: `/admin/group_rule`,
    method: 'get',
    params
  })
}
/**
 * 权限列表
 * @returns {AxiosPromise}
 */
export function access(id, data) {
  return request({
    url: `/admin/group_access/${id}`,
    method: 'post',
    data
  })
}
